//
//  YMCountDown.h
//  JP
//
//     on 2018/6/12.
//   . All rights reserved.
//

#import <Foundation/Foundation.h>

@class YMCountDown;
@protocol YMCountDownDelegate<NSObject>

- (void)countDownWillFire:(YMCountDown *)countDown;

- (void)countDown:(YMCountDown *)countDown runningTime:(NSTimeInterval)runningTime;


- (void)countDown:(YMCountDown *)countDown didStopInTime:(NSTimeInterval)time;

@end

@interface YMCountDown : NSObject
{
    @package NSTimer *_timer;
}
@property (nonatomic,weak) id<YMCountDownDelegate> delegate;

/**
 时间间隔，默认1s
 */
@property (nonatomic) NSTimeInterval interval;

/**
 总时长，默认60s
 */
@property (nonatomic) NSTimeInterval duration;


/**
 正在倒计时
 */
@property (nonatomic) BOOL running;


- (void)fire;

- (void)stop;

- (void)deallocTimer;

@end
